Ext.define('appfe.stockor.statist.buyinpoint.form.RealtimeBuyinPointForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.stockor.statist.buyinpoint.form.RealtimeBuyinPointForm',
    viewModel: {
        data: {
            realtimeBuyinPoint: {
                id: '',
                slimsymbol: '',
                name: '',
                grade: '',
                infoTime: '',
                topenPrice: '',
                tclosePrice: '',
                thighPrice: '',
                tlowPrice: '',
                volumeLotZ4: '',
                lowestInfoTime: '',
                lowestTopenPrice: '',
                lowestTclosePrice: '',
                lowestThighPrice: '',
                lowestTlowPrice: '',
                lowestVolumeLotZ4: '',
                status: '',
                tcloseIncreaseAmount: '',
                tcloseProfitRatio: '',
                diffMa13Ma5AvgTrendWeakRatio: '',
                backoff34TermsIslowest: '',
                backoff55TermsIslowest: '',
                backoff89TermsIslowest: '',
                backoff144TermsIslowest: '',
                comments: ''
                /*
                "id": 8891,
                "slimsymbol": "sz300680",
                "name": "隆盛科技",
                "grade": "DAY",
                "infoTime": "2021-10-18 00:00:00",
                "topenPrice": 25.9,
                "tclosePrice": 26.57,
                "thighPrice": 26.67,
                "tlowPrice": 24.91,
                "volumeLotZ4": 6,
                "lowestInfoTime": "2021-10-13 00:00:00",
                "lowestTopenPrice": 24.57,
                "lowestTclosePrice": 24.56,
                "lowestThighPrice": 24.73,
                "lowestTlowPrice": 23.87,
                "lowestVolumeLotZ4": 2,
                "status": "OPEN",
                "tcloseIncreaseAmount": 4.58,
                "tcloseProfitRatio": 0.1724,
                "diffMa13Ma5AvgTrendWeakRatio": -0.0811,
                "buyinPointIndex": 943,
                "backoff34TermsIslowest": true,
                "backoff55TermsIslowest": false,
                "backoff89TermsIslowest": false,
                "backoff144TermsIslowest": false,
                "comments": null,
                "createDate": null,
                "modifyDate": null                
                */
            }
        }
    },

    ui: 'won-form',
    autoScroll: true,
    buttonAlign: 'center',
    bodyPadding: 10,
    border: false,
    fieldDefaults: {
        msgTarget: 'side',
        labelAlign: 'top',
        //labelAlign: 'right',
        labelWidth: 100,
        labelStyle: 'color:blue;font-weight:bold',
        margin: '0 5 0 5'
    },
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    defaults: {
        // width: 600,
        anchor: '100%',
        resizable: true,
        grow: true,
        allowBlank: true
    },
    items: [{
        xtype: 'container',
        layout: 'anchor',
        defaults: {
            anchor: '100%',
            xtype: 'container',
            layout: 'hbox',
            margin: '5 0 5 0',
            defaults: {
                //xtype: 'displayfield'
                xtype: 'textfield'
            }
        },
        items: [{//第一行
            items: [
                {
                    flex: 1,
                    name: 'slimsymbol',
                    fieldLabel: '股票简码',
                    bind: '{realtimeBuyinPoint.slimsymbol}'
                }, {
                    flex: 1,
                    name: 'name',
                    fieldLabel: '股票名称',
                    bind: '{realtimeBuyinPoint.name}'
                }, {
                    flex: 1,
                    name: 'grade',
                    fieldLabel: '级别',
                    bind: '{realtimeBuyinPoint.grade}'
                }, {
                    flex: 1,
                    name: 'status',
                    fieldLabel: '状态',
                    afterLabelTextTpl: ['<span style="color:red;font-weight:bold" data-qtip="必填项">*</span>'],
                    bind: '{realtimeBuyinPoint.status}'
                },
                { flex: 1, xtype: 'displayfield' }
            ]
        }, { //第二行
            items: [
                {
                    flex: 1,
                    name: 'infoTime',
                    fieldLabel: '时间',
                    bind: '{realtimeBuyinPoint.infoTime}'
                }, {
                    flex: 1,
                    name: 'topenPrice',
                    decimalPrecision: 2,
                    fieldLabel: '开盘价',
                    bind: '{realtimeBuyinPoint.topenPrice}'
                }, {
                    flex: 1,
                    name: 'tclosePrice',
                    decimalPrecision: 2,
                    fieldLabel: '收盘价',
                    bind: '{realtimeBuyinPoint.tclosePrice}'
                }, {
                    flex: 1,
                    name: 'thighPrice',
                    decimalPrecision: 2,
                    fieldLabel: '最高价',
                    bind: '{realtimeBuyinPoint.thighPrice}'
                }, {
                    flex: 1,
                    name: 'tlowPrice',
                    decimalPrecision: 2,
                    fieldLabel: '最低价',
                    bind: '{realtimeBuyinPoint.tlowPrice}'
                }
            ]
        }, { //第三行
            items: [
                {
                    flex: 1,
                    name: 'lowestInfoTime',
                    fieldLabel: '低点时间',
                    bind: '{realtimeBuyinPoint.lowestInfoTime}'
                }, {
                    flex: 1,
                    name: 'lowestTopenPrice',
                    decimalPrecision: 2,
                    fieldLabel: '低点开盘价',
                    bind: '{realtimeBuyinPoint.lowestTopenPrice}'
                }, {
                    flex: 1,
                    name: 'lowestTclosePrice',
                    decimalPrecision: 2,
                    fieldLabel: '低点收盘价',
                    bind: '{realtimeBuyinPoint.lowestTclosePrice}'
                }, {
                    flex: 1,
                    name: 'lowestThighPrice',
                    decimalPrecision: 2,
                    fieldLabel: '低点最高价',
                    bind: '{realtimeBuyinPoint.lowestThighPrice}'
                }, {
                    flex: 1,
                    name: 'lowestTlowPrice',
                    decimalPrecision: 2,
                    fieldLabel: '低点最低价',
                    bind: '{realtimeBuyinPoint.lowestTlowPrice}'
                }
            ]
        },
        { //第四行
            xtype: 'fieldcontainer',
            fieldLabel: '背驰点前溯周期最低价状态',
            labelStyle: 'color:red;font-weight:bold;padding:0;',
            layout: 'hbox',
            defaultType: 'textfield',
            fieldDefaults: {
                labelAlign: 'top'
            },
            items: [
                {
                    flex: 1,
                    name: 'backoff34TermsIslowest',
                    fieldLabel: '前34期',
                    bind: '{realtimeBuyinPoint.backoff34TermsIslowest}'
                }, {
                    flex: 1,
                    name: 'backoff55TermsIslowest',
                    fieldLabel: '前55期',
                    bind: '{realtimeBuyinPoint.backoff55TermsIslowest}'
                }, {
                    flex: 1,
                    name: 'backoff89TermsIslowest',
                    fieldLabel: '前89期',
                    bind: '{realtimeBuyinPoint.backoff89TermsIslowest}'
                }, {
                    flex: 1,
                    name: 'backoff144TermsIslowest',
                    fieldLabel: '前144期',
                    bind: '{realtimeBuyinPoint.backoff144TermsIslowest}'
                },
                { flex: 1, xtype: 'displayfield' }
            ]
        }, { //第五行
            items: [
                {
                    flex: 1,
                    name: 'tcloseIncreaseAmount',
                    decimalPrecision: 2,
                    fieldLabel: '利润额',
                    bind: '{realtimeBuyinPoint.tcloseIncreaseAmount}'
                }, {
                    flex: 1,
                    name: 'tcloseProfitRatio',
                    decimalPrecision: 2,
                    fieldLabel: '利润率',
                    bind: '{realtimeBuyinPoint.tcloseProfitRatio}'
                },
                { flex: 1, xtype: 'displayfield' },
                { flex: 1, xtype: 'displayfield' },
                { flex: 1, xtype: 'displayfield' }
            ]
        }, { //第五行
            items: [
                {
                    flex: 5,
                    xtype: 'textareafield',
                    name: 'comments',
                    fieldLabel: '备注',
                    bind: '{realtimeBuyinPoint.comments}',
                    autoHeight: true,
                    allowBlank: true
                }
            ]
        }]
    }]
});